<template>
    <div class="main_box" style="padding:10px">
        <div class="add_wrap">
            <el-form label-width="200px">
                <div class="tit">
                    <h2>基础信息</h2>
                    <el-button type="success" plain size="small" icon="fa fa-mail-forward" @click="returnList">返回
                    </el-button>
                </div>
                <el-row>
                    <el-form-item label="活动编号:">
                        <span>{{ dataInfo.activeNo }}</span>
                    </el-form-item>
                    <el-form-item label="活动名称:">
                        <span>{{ dataInfo.activeName }}</span>
                    </el-form-item>
                    <el-form-item label="活动类型:">
                        <span>{{ dataInfo.activeType==1?'店铺活动':'缴费活动' }}</span>
                    </el-form-item>
                    <el-form-item label="商家名称:">
                        <span>{{ dataInfo.businessName }}</span>
                    </el-form-item>
                    <el-form-item label="创建人:">
                        <span>{{ dataInfo.createUserName }}</span>
                    </el-form-item>
                    <el-form-item label="创建时间:">
                        <span>{{ dataInfo.createDate }}</span>
                    </el-form-item>
                    <el-form-item label="修改人:">
                        <span>{{ dataInfo.modifyUserName }}</span>
                    </el-form-item>
                    <el-form-item label="修改时间:">
                        <span>{{ dataInfo.modifyDate }}</span>
                    </el-form-item>
                    <el-form-item label="备注:">
                        <span>{{ dataInfo.remark }}</span>
                    </el-form-item>
                </el-row>
                <div>
                    <h2>活动货品列表</h2>
                </div>
                <el-row>
                    <el-table ref="tableList" :data="list">
                    <el-table-column prop="businessName" label="商户名称" align="center">

                    </el-table-column>
                    <el-table-column prop="promoteRuleName" label="推广规则名称" align="center">

                    </el-table-column>
                    <el-table-column label="推广规则类型" align="center">
                        <template slot-scope="scope">
                            {{ scope.row.ruleType==1?'商户':'平台' }}
                        </template>
                    </el-table-column>
                    </el-table>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script>
import PromoteModelApi from '@/api/operation/promoteModel';
export default {
    data() {
        return {
            dataInfo: {},
            list:[],
        };
    },

    mounted() {
        this.getData()
    },
    methods: {
        getData() {

            PromoteModelApi.getPromoteModel({ id: this.$route.query.id }).then(res => {
                this.dataInfo = res.data
                this.list = res.data.list
            })
        },
        returnList() {
            this.$store.dispatch('delView', this.$route);
            this.$router.push({ path: '/operation/promoteModelManagement' })
        }
    },

}

</script>
<style lang="scss" scoped>
@import "@/assets/css/views/add.scss";
</style>
